﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Style x:Key="listBoxItemStyle" TargetType="{x:Type ListBoxItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                    <Grid Background="{TemplateBinding Background}">
                        <Border CornerRadius="4" BorderThickness="1" x:Name="itemBorder" Margin="0" Width="{Binding ActualWidth, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ScrollContentPresenter}}}" >
                            <ContentPresenter />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter TargetName="itemBorder" Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Color="#DCEBFC" Offset="0" />
                                        <GradientStop Color="#CDE2FC" Offset="0.5" />
                                        <GradientStop Color="#C1DBFC" Offset="1" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="itemBorder" Property="BorderBrush" Value="CornflowerBlue" />
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="False" />
                                <Condition Property="IsMouseOver" Value="True" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="itemBorder" Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1" Opacity="0.25">
                                        <GradientStop Color="#DCEBFC" Offset="0" />
                                        <GradientStop Color="#CDE2FC" Offset="0.5" />
                                        <GradientStop Color="#C1DBFC" Offset="1" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="itemBorder" Property="BorderBrush">
                                <Setter.Value>
                                    <SolidColorBrush Color="CornflowerBlue" Opacity="0.25" />
                                </Setter.Value>
                            </Setter>
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>